{extend name="default/base" /}
{block name="main"}
  <div class='wst-toolbar'>
     <input type='text' class="s-ipt" id='orderNo' placeholder='订单号'/> 
     <select name="payType" id="payType" class="s-ipt">
                <option value="-1">支付方式</option>
                <option value="0">货到付款</option>
                <option value="1">在线支付</option>
               </select>

     <select name="deliverType" id="deliverType" class="s-ipt">
                <option value="-1">配送方式</option>
                <option value="0">送货上门</option>
                <option value="1">自提</option>
               </select>

      <a class="btn btn-primary" onclick="deliveredByPage()"><i class="fa fa-search"></i>查询</a>
      <a class="btn btn-primary" style="float:right;" onclick="javascript:toExport(2,1,'')"><i class="fa fa-sign-out"></i>导出</a>
  </div>
  <div class='wst-grid'>
    <table class='wst-order-list'>
       <thead>
	      <tr class='head'>
	         <th class="th-padding">订单详情</th>
	         <th width="107">支付方式/配送信息</th>
	         <th>金额</th>
	         <th width="87">操作</th>
	      </tr>
	   </thead>
	   <tbody id='loadingBdy'>
	       <tr id='loading' class='empty-row' style='display:none'>
	            <td colspan='4'><img src="__SHOP__/img/loading.gif">正在加载数据...</td>
	       </tr>
       </tbody>
       <script id="tblist" type="text/html">
       {{# for(var i = 0; i < d.length; i++){ }}
       <tbody class="j-order-row {{#if(d[i].payType==1){}}j-warn{{#} }}">
         <tr class='empty-row'>
            <td colspan='4'>&nbsp;</td>
         </tr>
         <tr class='order-head'>
            <td colspan='4' align='right'>
              <div class='time'>{{d[i].createTime}}</div>
              <div class='orderno'>订单号：{{d[i].orderNo}}
      			    {{# if(d[i].orderSrc==0){ }}<i class="order-pc"></i>
      			    {{# }else if(d[i].orderSrc==1){ }}<i class="order-wx"></i>
        				{{# }else if(d[i].orderSrc==2){ }}<i class="order-mo"></i>
        				{{# }else if(d[i].orderSrc==3){ }}<i class="order-app"></i>
        				{{# }else if(d[i].orderSrc==4){ }}<i class="order-ios"></i>
                {{# }else if(d[i].orderSrc==5){ }}<i class="order-weapp"></i>
      			    {{# } }}
                {{# if(d[i].orderCodeTitle!=""){ }}
                  <span class="order_from">{{d[i].orderCodeTitle}}</span>
                {{# } }}
      			  </div>
              <div>{{d[i].status}} </div>
            </td>
         </tr>
         {{# 
          var tmp = null,rows = d[i]['list'].length;
          for(var j = 0; j < d[i]['list'].length; j++){
             tmp = d[i]['list'][j]; 
         }}
         <tr class='goods-box'>
            <td>
               <div class='goods-img'>
                <a href="{{WST.U('home/goods/detail','goodsId='+tmp.goodsId)}}" target='_blank'>
                    <span class='weixin'><img class='img gImg' title='{{tmp.goodsName}}' style='height:60px;width:60px;' data-original='__RESOURCE_PATH__/{{tmp.goodsImg}}'><img class='imged' style='height:200px;width:200px;max-width: 200px;max-height: 200px;' title='{{tmp.goodsName}}' src="__RESOURCE_PATH__/{{tmp.goodsImg}}"></span>
                </a>
               </div>
               
               <div class='goods-name'>
                 <div>{{tmp.goodsName}}</div>
                 <div>{{tmp.goodsSpecNames}}</div>
               </div>
               <div class='goods-extra'>{{tmp.goodsPrice}} x {{tmp.goodsNum}}</div>
            </td>
            {{# if(j==0){ }}
            <td rowspan="{{rows}}">
                <div>{{d[i].payTypeName}}</div>
                <div>{{d[i].deliverTypeName}}</div>
            </td>
            <td rowspan="{{rows}}">
                <div>商品金额：¥{{d[i].goodsMoney}}</div>
                <div class='line'>运费：¥{{d[i].deliverMoney}}</div>
                <div>实付金额：¥{{d[i].realTotalMoney}}</div>
            </td>
            <td rowspan="{{rows}}">
                <div><a target='blank' href='{{WST.U("shop/orders/orderPrint","id="+d[i].orderId)}}'>【打印订单】</a></div>
                <div><a href='#none' onclick="view({{d[i].orderId}},'delivered')">【订单详情】</a></div>
            </td>
            {{#}}}
         </tr>
         {{# } }}
         <tr>
          <td colspan="4">
            {{# if(WST.blank(d[i].orderRemarks)!=''){  }}
               <div class="order_remaker">
               【用户留言】{{d[i].orderRemarks}}
               </div>
             {{# }  }}
          </td>
         </tr>
       </tbody>
       {{# } }}
       </script>
       <tr class='empty-row'>
            <td colspan='4' id='pager' align="center" style='padding:5px 0px 5px 0px'>&nbsp;</td>
       </tr>
    </table>
    
  </div>
{/block}
{block name="js"}
<script type="text/javascript" src="__STATIC__/js/jquery.min.js?v={$v}"></script>
<script type="text/javascript" src="__STATIC__/plugins/layer/layer.js?v={$v}"></script>
<script type='text/javascript' src='__ROOT__/static/plugins/lazyload/jquery.lazyload.min.js?v={$v}'></script>
<script type='text/javascript' src='__SHOP__/orders/orders.js?v={$v}'></script>
<script>
$(function(){
	deliveredByPage({$p});
})
</script>
{/block}
